#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
import time


def myprint(obj, end='\n'):
    sys.stdout.write(str(obj) + end)


def main():
    tstr = '2012-03-21T10:37:29'
    fm1 = '%Y-%m-%dT%H:%M:%S'

    # convert string to struct_time

    t = time.strptime(tstr, fm1)
    myprint(t)

    # convert struct_time to string

    fm2 = '%d-%b-%Y'
    ts = time.strftime(fm2, t)
    myprint(ts)


if __name__ == '__main__':
    main()
    myprint('done')
